<template>
    <div id="OrdersDelivery">
        <v-details :detailData="inputData" :inputConfig="inputConfig" @pop="setData"></v-details>
    </div>
</template>

<script>
    import details from 'commons/Detail'
    import baseMixin from "@/mixins/BaseMixin";

    export default {
        mixins: [baseMixin],
        props: {
            inputData: {
                type: Object
            }
        },
        name: "OrdersDelivery",
        data() {
            return {
                inputConfig: [
                    [
                        {
                            type: "input",
                            label: this.$t('out.orderkey'),
                            disabled: true,
                            props: "orderkey"
                        },
                        {
                            type: "table",
                            label: this.$t('out.consigneekey'),
                            disabled: false,
                            props: "consigneekey",
                            tableConfig: [
                                {
                                    label: this.$t('config.shipper'),
                                    prop: "storerkey",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.company'),
                                    prop: "company",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.city'),
                                    prop: "city",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.provice'),
                                    prop: "state",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.postcode'),
                                    prop: "zip",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.contact'),
                                    prop: "contact",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.phone'),
                                    prop: "phone",
                                    input: "input",
                                }
                            ],
                            url: `queryStorer/2/?/${this.$store.state.wms}`
                        },
                        {
                            type: "input",
                            label: this.$t('out.b_vat'),
                            disabled: false,
                            props: "c_vat"
                        },
                        {
                            type: "select",
                            label: this.$t('bill.countryCode'),
                            disabled: false,
                            props: "c_isocntrycode",
                            options: this.getOptions("querycodeLkup/ISOCOUNTRY")
                        },
                    ],
                    [
                        {
                            type: "input",
                            label: this.$t('out.c_company'),
                            disabled: false,
                            props: "c_company"
                        },
                        {
                            type: "input",
                            label: this.$t('out.c_address',{no:1}),
                            disabled: false,
                            props: "c_address1"
                        },
                        {
                            type: "input",
                            label: this.$t('out.c_address',{no:2}),
                            disabled: false,
                            props: "c_address2"
                        },
                        {
                            type: "input",
                            label: this.$t('out.c_address',{no:3}),
                            disabled: false,
                            props: "c_address3"
                        },
                        {
                            type: "input",
                            label: this.$t('out.c_address',{no:4}),
                            disabled: false,
                            props: "c_address4"
                        },
                        {
                            type: "input",
                            label: this.$t('out.c_address',{no:5}),
                            disabled: false,
                            props: "c_address5"
                        },
                        {
                            type: "input",
                            label: this.$t('out.c_address',{no:6}),
                            disabled: false,
                            props: "c_address6"
                        },
                    ],
                    [
                        {
                            type: "input",
                            label: this.$t('config.city'),
                            disabled: false,
                            props: "c_city"
                        },
                        {
                            type: "input",
                            label: this.$t('config.provice'),
                            disabled: false,
                            props: "c_state"
                        },
                        {
                            type: "input",
                            label: this.$t('config.postcode'),
                            disabled: false,
                            props: "c_zip"
                        },
                        {
                            type: "input",
                            label: this.$t('config.contact'),
                            disabled: false,
                            props: "c_contact1"
                        },
                        {
                            type: "input",
                            label: this.$t('config.phone'),
                            disabled: false,
                            props: "c_phone1"
                        },
                        {
                            type: "input",
                            label: this.$t('out.fax'),
                            disabled: false,
                            props: "c_fax1"
                        },
                        {
                            type: "input",
                            label: this.$t('app.email'),
                            disabled: false,
                            props: "c_email1"
                        },
                        {
                            type: "input",
                            label: this.$t('out.rtxexpresskey'),
                            disabled: false,
                            props: "rtxexpresskey"
                        },
                    ]
                ],
            }
        },
        methods: {
            async setData(data, id, close, listId) {
                this.inputData.consigneekey = data.storerkey;
            }
        },
        mounted() {
        },
        components: {
            'v-details': details
        }
    }
</script>

<style scoped>

</style>

